package main

import (
	"bootstrap"
	"flag"
	"leaf"
	"test_client/gate"
	. "test_client/internal"
	"test_client/logic"
)

import (
	_ "test_client/logic/launcher"
)

var (
	configPath string
)

func init() {
	flag.StringVar(&configPath, "config", "test_client.json", "test client config file path")
}

func main() {
	flag.Parse()
	Config.Parse(configPath)

	args := new(bootstrap.StartArgs)
	args.Config = &Config.Bootstrap
	defer bootstrap.Close()
	bootstrap.Start(args)

	leaf.Run(
		&Config.Leaf,
		logic.Module,
		gate.Module,
	)
}
